﻿-- =============================================
-- Author:		Andreas Könighofer (IT-eXperience)
-- Create date: 14.01.2009
-- Description:	Updates existing Resource.
-- =============================================
CREATE PROCEDURE [dbo].[UpdateResource]
	-- Add the parameters for the stored procedure here
	@ResourceID INT
	, @LocationID SMALLINT = NULL
	, @RessourceName NVARCHAR(100) = NULL
	, @SSNo NVARCHAR(50) = NULL
	, @MachineTypeID SMALLINT = NULL
	, @Status NVARCHAR(50) = NULL
	, @SerialNo NVARCHAR(50) = NULL
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    UPDATE [BigDays2009].[dbo].[Resource]
   SET [LocationID] = ISNULL(@LocationID, LocationID)
      ,[RessourceName] = ISNULL(@RessourceName, RessourceName)
      ,[SSNo] = ISNULL(@SSNo, SSNo)
      ,[MachineTypeID] = ISNULL(@MachineTypeID, MachineTypeID)
      ,[Status] = ISNULL(@Status, Status)
      ,[SerialNo] = ISNULL(@SerialNo, SerialNo)
	WHERE ResourceID = @ResourceID
END

---- end script UpdateResource stored procedure ----
---- end script update stored procedures -------

---- start script delete stored procedures -----
---- start script DeleteCustomer stored procedure ----

